package com.projectframe.base.exception;

import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class BaseException extends RuntimeException
{
    private Object[]            args          = null;
    private String              messageCode   = "";
    private int                 status        = -1;
    private Object              result        = null;
    private List<BaseException> exceptionList = new ArrayList<BaseException>(0);

    public BaseException()
    {}

    public BaseException(final String messageCode)
    {
        super(messageCode);
        this.messageCode = messageCode;
    }

    public BaseException(final String messageCode, final Object[] args)
    {
        super(messageCode);
        this.messageCode = messageCode;
        this.args = args;
    }

    public BaseException(final String messageCode, final Throwable cause)
    {
        super(cause.getMessage(), cause);
        this.messageCode = messageCode;
    }

    public BaseException(final String messageCode, final Throwable cause, final Object[] args)
    {
        super(cause.getMessage(), cause);
        this.args = args;
        this.messageCode = messageCode;
    }

    public Object[] getArgs()
    {
        return args;
    }

    public void setArgs(final Object[] args)
    {
        this.args = args;
    }

    public String getMessageCode()
    {
        return messageCode;
    }

    public void setMessageCode(final String messageCode)
    {
        this.messageCode = messageCode;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(final int status)
    {
        this.status = status;
    }

    public void addOtherException(final BaseException pos3ge)
    {
        exceptionList.add(pos3ge);
    }

    public List<BaseException> getExceptionList()
    {
        return exceptionList;
    }

    public Object getResult()
    {
        return result;
    }

    public void setResult(final Object result)
    {
        this.result = result;
    }
}
